<div class="widget">
              <div class="box">
              	<h3>System Status</h3>
                	<ul class="list1">
                         <li>
                         	<?php
							$sql = "SELECT * FROM `tbConfig` WHERE `sConfigName` = 'siteDown'";
							$q = db::Query($sql);
							$row = $q->fetch();
							?>
                         	TSC Portal System
                            <?php if($row['sConfigValue'] == 'false'){ ?>
                            <span style="float:right; color:#090; padding-right:5px;">Good</span>
                            <?php }else{ ?>
                            <span style="float:right; color:#900; padding-right:5px;">Down</span>
                            <?php } ?>
                         </li>
                         <li>
                         	<?php
							$CONFIG['current_mysql_credentials']['mysql_database'] = 'inventory';
							$CONFIG['current_mysql_credentials']['mysql_user'] = 'inventory';
							$CONFIG['current_mysql_credentials']['mysql_pass'] = '8DNWxqKDNhTwdBfY';
							db::disconnect();
							$sql = "SELECT * FROM `tbConfig` WHERE `sVariable` = 'siteDown'";
							$q = db::Query($sql);
							$row = $q->fetch();
							?>
                         	Inventory System
                            <?php if($row['sValue'] == 'false'){ ?>
                            <span style="float:right; color:#090; padding-right:5px;">Good</span>
                            <?php }else{ ?>
                            <span style="float:right; color:#900; padding-right:5px;">Down</span>
                            <?php } ?>
                         </li>
                         <li>
                         	<?php
	                        $CONFIG['current_mysql_credentials']['mysql_database'] = 'k103';
							$CONFIG['current_mysql_credentials']['mysql_user'] = 'techcenter';
							$CONFIG['current_mysql_credentials']['mysql_pass'] = 'Btv6Et6ARThrjbQb';
							db::disconnect();
							$sql = "SELECT * FROM `tbKLabVisits` ORDER BY `iID` DESC LIMIT 0, 1";
							$q = db::Query($sql);
							$row = $q->fetch();
							$time = strtotime($row['sDate']." ".$row['sTime']);
							?>
                         	K-103 Lab System
                            <?php if(time() < $time + 30 and $row['sVerified'] == 0){ ?>
                            <span style="float:right; color:#900; padding-right:5px;">Down</span>
                            <?php }else{ ?>
                            <span style="float:right; color:#090; padding-right:5px;">Good</span>
                            <?php } ?>
                         </li>
                         <li>
                         	<?php
							$CONFIG['current_mysql_credentials']['mysql_database'] = 'inventory';
							$CONFIG['current_mysql_credentials']['mysql_user'] = 'inventory';
							$CONFIG['current_mysql_credentials']['mysql_pass'] = '8DNWxqKDNhTwdBfY';
							db::disconnect();
							$sql = "SELECT * FROM `tbLog` ORDER BY `iID` DESC LIMIT 0, 1";
							$q = db::Query($sql);
							$row = $q->fetch();
							
							$sql = "SELECT * FROM `tbConfig` WHERE `sVariable` = 'systemBotDown'";
							$q = db::Query($sql);
							$row2 = $q->fetch();
							?>
                         	Inventory System Bot
                            <?php if($row2['sValue'] == 'true'){ ?>
                            <span style="float:right; color:#900; padding-right:5px;">Down</span>
                            <?php }elseif(time() < $row['tTimeStamp'] + 300){ ?>
                            <span style="float:right; color:#090; padding-right:5px;">Active</span>
                            <?php }else{ ?>
                            <span style="float:right; color:#F60; padding-right:5px;">Idle</span>
                            <?php } ?>
                            <?php 
							$CONFIG['current_mysql_credentials']['mysql_database'] = 'techcenter';
							$CONFIG['current_mysql_credentials']['mysql_user'] = 'techcenter';
							$CONFIG['current_mysql_credentials']['mysql_pass'] = 'Btv6Et6ARThrjbQb';
							db::disconnect();
							?>
                         </li>
                    </ul>
               </div>
            </div>